<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			function $$(id){
			
				return document.getElementById(id)
			}
			window.onload=function(){
				var cnv=$$("canvas")
				var cxt=cnv.getContext("2d")
				var image=new Image()
				image.src="img/4.jpg"
				image.onload=function(){
					cxt.drawImage(image,10,10)
					var imgData=cxt.getImageData(10,10,120,120)
					var data=imgData.data				
					for(i=0;i<data.length;i+=4){
						data[i+3]=data[i+3]*0.3
					}
					cxt.putImageData(imgData,140,10)
				}
			}
		</script>
	</head>
	<body>
		<canvas id="canvas" width="300" height="150" style="border: 1px dashed gray;"></canvas>
	</body>
</html>
